import 'package:flutter/material.dart';

class StackWidget extends StatelessWidget {
  const StackWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('stack组件'),
        backgroundColor: Colors.amber,
      ),
      body: Center(
        child: Stack(
          // 超出部分处理
          // 不裁剪超出部分
          clipBehavior: Clip.none,
          // 组价对齐方式
          alignment: Alignment.center,
          children: [
            Container(width: 200, height: 200, color: Colors.blue),
            Positioned(top: -100, child: Image.asset('assets/open_eyes.png')),
          ],
        ),
      ),
    );
  }
}
